home *** CD-ROM | disk | FTP | other *** search
- Path: noc.tor.hookup.net!news
- From: Richard Steadman <rsteadma@micromedia.on.ca>
- Newsgroups: comp.lang.c
- Subject: Q: "Overlapping Objects"
- Date: Sun, 14 Apr 1996 14:22:56 -0400
- Organization: Micromedia
- Message-ID: <31714280.201A@micromedia.on.ca>
- NNTP-Posting-Host: keeper.mmltd.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win95; I)
-
- Hello.
-
- I have a question which is quite simple, but I can't seem to find
- the right answer anywhere.
-
- I'm trying to figure out when it is necessary to use the memmove()
- function when copying strings. K&R and the man page says to use it
- when the "objects overlap". But I can't find a formal definition
- for this phrase (it's not in the FAQ either -- I checked!).
-
- Here's the scenario: I have a string, and want to copy the tail of
- it to an earlier part of the string. The two pieces are *not*
- overlappng when the function is called, but they may be when the
- copy is finished.
-
- Given this, it safe to use strcat() instead of memmove()?
-
- Thanks,
-
- Richard Steadman
- rsteadma@mmltd.com
-
-